package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter@Getter@ToString
public class Duty {
    private Long id;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date date;

    private Employee employee;

    private Department department;

    /*
        DateTimeFormat:前端传入后台配置的日期格式
        JSONField:后台传入前台配置的日期格式,该配置会复盖mvc.xml中配置的日期格式
    * */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "HH:mm:ss")
    private Date signOn;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "HH:mm:ss")
    private Date signOff;

    private Boolean state=true;

}